
package com.mengtian_tech.tju.dataquery.api.controller.admin;


import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;

import com.github.pagehelper.util.StringUtil;
import com.mengtian_tech.tju.dataquery.api.model.tjuOracle.Employee;
import com.mengtian_tech.tju.dataquery.api.service.EmployeeService;
import com.mengtian_tech.tju.dataquery.api.util.ResponseUtil;

/**
 * ${remark}
 * @author wxd56
 *
 */
@RestController
@RequestMapping("/api/emp")
@Validated
public class EmployeeController{
	
	@Autowired
	EmployeeService service;
	
	
	/**
	 * 获取列表
	 * @throws Exception 
	 */
	@GetMapping("list")	
	public Object list(Integer page, Integer limit,String staffId,String staffName) throws Exception {
		 
		 
		
		if(StringUtil.isEmpty(staffId) && StringUtil.isEmpty(staffName)) {
			return ResponseUtil.ok();
		}
		
		if(page == null) page = 1;
		if(limit == null) limit = 10;
		if(limit > 100) limit = 100;
		
		return ResponseUtil.okList(this.service.getPageList(page, limit,staffName,staffId));
	}	
	
}